	<div class="wrapper wrapper-content animated fadeInRight">
		<div style="margin: 0;">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input id="roleId" name="roleId" type="hidden" value="${role.roleId!}"> <input id="menuIds"
								name="menuIds" type="hidden">
							<div class="form-group">
								<label class="col-sm-3 control-label">角色名：</label>
								<div class="col-sm-8">
									<input id="roleName" name="roleName" class="form-control" type="text" value="${role.roleName!}"/>
								</div>
							</div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">角色名标识：</label>
                                <div class="col-sm-8">
                                    <input id="roleSign" name="roleSign" class="form-control" type="text" value="${role.roleSign!}"/>
                                </div>
                            </div>
							<div class="form-group">
								<label class="col-sm-3 control-label">备注：</label>
								<div class="col-sm-8">
									<input id="remark" name="remark" class="form-control"
										type="text" value="${role.remark!}">
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
$(function() {
	validateRule();
});
function update() {
	var role = $('#signupForm').serialize();
	 var url = "/sys/role/save";
        var roleId = $("#roleId").val();
        if (roleId != '' && roleId != undefined) {
            url = "/sys/role/update";
        }
	$.ajax({
		cache : true,
		type : "POST",
		url : url,
		data : role,
		async : false,
		error : function(request) {
			alert("Connection error");
		},
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
				reLoad();
				layer.close(current_index);
			} else {
				layer.msg(r.msg);
			}

		}
	});
}
function validateRule() {
	var icon = "<i class='fa fa-times-circle'></i> ";
	$("#signupForm").validate({
           	rules : {
				roleName : {
					required : true
				}
			},
         	messages : {
				roleName : {
					required : icon + "请输入角色名"
				}
			},
            submitHandler: function (form) {
                update();
            },
            invalidHandler: function (form, validator) {
                return false;
            }
        })
}
	</script>
